<?php

namespace Home\DAO;

/**
 * 微信API DAO
 *
 * @author 李静波
 */
class WeixinDAO extends PSIBaseDAO {

	/**
	 * 获得微信公众号AppId等信息
	 */
	public function getWeixinConfig() {
		$result = array();
		
		$db = M();
		$sql = "select app_id, app_secret, redirect_uri, is_released 
				from t_weixin_config limit 1";
		
		$data = $db->query($sql);
		if ($data) {
			$result["appId"] = $data[0]["app_id"];
			$result["appSecret"] = $data[0]["app_secret"];
			$result["redirectURI"] = $data[0]["redirect_uri"];
			$result["isReleased"] = $data[0]["is_released"];
		}
		
		return $result;
	}
}